<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>

<!doctype html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<link rel="stylesheet" href="css/base.css" />
		<link rel="stylesheet" href="css/login.css" />
		<title>办公自动化系统</title>
		<script type="text/javascript" src="js/jquery.js"></script>
		<style type="text/css">
			.login .login-top h1{ height:161px; margin-left:27px; background:url(../images/login_logo.png) no-repeat left center;}
		</style>
		<script type="text/javascript">
	function checkLogin() {
		var account = $(":text").val();
		var pwd = $(":password").val();
		if (account == null || account == "") {
			alert("用户名不能为空");
		} else if (pwd == null || pwd == "") {
			alert("密码不能为空");
		} else if (account.indexOf("OA") == -1) {
			alert("用户名格式不正确");
		} else {
			ajaxCheck(account, pwd);
		}
	}

	function ajaxCheck(account, pwd) {
		$.ajax( {
			type : "post",
			url : "LoginManager.action?method=check",
			data : "account=" + account + "&pwd=" + pwd,
			success : function(flag) {
				if (flag == 1 || flag == 4) {
					alert("账户不存在");
				} else if (flag == 2) {
					alert("密码不正确");
				} else {
					var url = "${pageContext.request.contextPath}/projectManage.action?method=mailNum";
					window.location.href = url;
				}
			}
		});
	}
</script>
	</head>
	<body>
		<div id="container">
			<div id="bd">
				<div class="login1">
					<div class="login-top">
						<h1 class="logo"></h1>
					</div>
					<div class="login-input">
						<p class="user ue-clear">
							<label>
								用户名
							</label>
							<input type="text" />
						</p>
						<p class="password ue-clear">
							<label>
								密&nbsp;&nbsp;&nbsp;码
							</label>
							<input type="password" />
						</p>
					</div>
					<div class="login-btn ue-clear">
						<a href="javascript:checkLogin();" class="btn">登录</a>
					</div>
				</div>
			</div>
		</div>
		<div id="ft">
			OASystem&nbsp;2017&nbsp;&nbsp;版权所有&nbsp;&nbsp;a8450432@126.com专注于ui设计&nbsp;&nbsp;皖ICP备09001111号
		</div>
	</body>
</html>